/**
 * @file clib/lib.threadpool.c
 * @author Guannan Ma()
 * @date 2013/02/03 13:27:26
 * @brief Whatever license applied.
 **/

struct _thdpoll_info{
    BOOL bInit;
    uint16 nworker;
    uint16 running;
    dLinkList *pdlink_run;
    dLinkList *pdlink_pend;
    struct mlock m_lock; 
    pthread_t *pthds;
};

static struct _thdpoll_info _thdinfo;
BOOL thdpool_init(int n_worker){
    _thdinfo.pdlink_run = initDLinkList();
    if( NULL == _thdpoll_info.pdlink_run ){
        return FALSE;
    }
    _thdpoll_info.nworker = n_worker;
    mlock_init(&_thdpoll_info.m_lock);
    _thdpoll_info.bInit = TRUE;
    return TRUE;
}

BOOL thdpoll_run(){
    pthread_t 
}


BOOL thdpool_addjob(struct thd_job * p_job){
    if ( TRUE != _thdpoll_info.bInit ){
        setErrStatusCode(INIT_NOT_INITED);
        return FALSE;
    }
    mlock_lock(&_thdpoll_info.m_lock);
}

/* vim: set tw=0 ts=4 sw=4 et: */
